﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 乐观并发控制
{
    internal class HouseConfig : IEntityTypeConfiguration<House>
    {
        public void Configure(EntityTypeBuilder<House> builder)
        {
            builder.ToTable("T_Houses");
            builder.Property(h => h.Name).IsUnicode();
            //乐观并发控制：并发令牌
            builder.Property(h => h.Owner).IsConcurrencyToken();
            //乐观并发控制：RowVersion 只能在UseSqlServer
            //builder.Property(h => h.RowVer).IsRowVersion();

        }
    }
}
